import request from '/@/utils/request';

/**
 * 后端控制菜单模拟json

 */

/**
 * 获取后端动态路由菜单(admin)

 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export function getDictionaryList(params?: object) {
    return request({
        url: '/api/system/dictionary/category/data/tree',
        method: 'get',
        params,
    });
}

export function saveDictionary(keyValue: String,params: object) {
    return request({
        url: '/api/system/dictionary/category/save?keyValue='+keyValue,
		method: 'post',
		data:params,
    });
}


export function getDictionaryEntity(categoryId?: String) {
    return request({
        url: '/api/system/dictionary/category/data/entity',
        method: 'get',
        params:{keyValue: categoryId}
    });
}


export function deleteDictionary(categoryId: String) {
    return request({
        url: '/api/system/dictionary/category/delete/'+categoryId,
		method: 'delete',
    });
}


export function getDictionaryContentList(categoryId?: String) {
    return request({
        url: '/api/system/dictionary/content/data',
        method: 'get',
        params:{queryJson:JSON.stringify({categoryId:categoryId})},
    });
}

export function saveDictionaryContent(keyValue: String,params: object) {
    return request({
        url: '/api/system/dictionary/content/save?keyValue='+keyValue,
		method: 'post',
		data:params,
    });
}

export function getDictionaryContentEntity(contentId?: String) {
    return request({
        url: '/api/system/dictionary/content/data/entity',
        method: 'get',
        params:{keyValue: contentId}
    });
}

export function deleteDictionaryContent(contentId: String) {
    return request({
        url: '/api/system/dictionary/content/delete/'+contentId,
		method: 'delete',
    });
}

